Language Basic Variables

In Java, variables are used to store data values that can be accessed and manipulated by the program. They are defined by a data type, a name, and an optional initial value. This note covers the types of variables in Java, the rules and conventions for naming fields, and how variables are managed and manipulated by the program.

The variable types

Instance Variables - Non-static Fields

Image

Image from w3resource.com "Java Class, methods, instance variables"

Class Variables - Static Fields

Image

Image from javaconceptoftheday.com "Class Variables And Instance Variables In Java "

Local Variables

Image

Image from dev.to Hamid Mohamadi "Lesson 4: Variables In Java"

Parameter

Naming Conventions

References